<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link href='/pintuan/Public/Member/css/global.css' rel='stylesheet' type='text/css' />


<!-- 整体页面布局 -->
<link href='/pintuan/Public/Member/css/main.css' rel='stylesheet' type='text/css' />
<link href='/pintuan/Public/Member/css/mall.css' rel='stylesheet' type='text/css' />

<!-- 基础js调用 -->
<script type='text/javascript' src='/pintuan/Public/Member/js/jquery-1.7.2.min.js'></script>
<script type='text/javascript' src='/pintuan/Public/Member/js/global.js'></script>
<script type='text/javascript' src='/pintuan/Public/Member/js/mall.js'></script>





<link href='/pintuan/Public/Member/css/wechat.css' rel='stylesheet' type='text/css' />
<script type='text/javascript' src='/pintuan/Public/Member/js/wechat.js'></script>
<script type="text/javascript" src="/pintuan/Public/Member/js/operamasks-ui.min.js"></script>


<!-- 单日期日历插件 -->
<link href="/pintuan/Public/Member/css/datepicker.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/pintuan/Public/Member/js/datepicker.js"></script>

<!-- 双日期日历插件 -->
<link href='/pintuan/Public/Member/css/daterangepicker.css' rel='stylesheet' type='text/css' />
<script type='text/javascript' src='/pintuan/Public/Member/js/moment.min.js'></script>
<script type='text/javascript' src='/pintuan/Public/Member/js/daterangepicker.js'></script>

<script type='text/javascript'>
var web_domain='/pintuan';
var static_domain='/pintuan';
var img_domain='/pintuan';
var _PUBLIC_ = '/pintuan/Public';
var _FILE_ = '<?php echo U('Index/ajaxFileUpload');?>';
var domain={
        www:'<?php echo C('WEB_ABSOLUTE_URL');?>',
        static:'<?php echo C('WEB_ABSOLUTE_URL');?>',
        img:'<?php echo C('WEB_ABSOLUTE_URL');?>',
        file:'<?php echo C('WEB_ABSOLUTE_URL');?>',
        kf:'<?php echo C('WEB_ABSOLUTE_URL');?>'
};
</script>

<script type="text/javascript" src="/pintuan/Public/Member/api/js/product.js"></script>


<script language="javascript">$(document).ready(product_obj.product_add);</script> 
<script type="text/javascript">var id = "<?php echo ($productinfo["id"]); ?>";</script>


	
	<script type="text/javascript" charset="utf-8" src="/pintuan/Public/Member/js/plugin/ckfinder/ckfinder.js"></script>
	<script type="text/javascript" charset="utf-8" src="/pintuan/Public/Member/api/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/pintuan/Public/Member/api/ueditor/ueditor.all.min.js"> </script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="/pintuan/Public/Member/api/ueditor/lang/zh-cn/zh-cn.js"></script>
	<script>	
	var ue = UE.getEditor('editor');
	</script>

</head>

<body>
    <div id="iframe_page">
        <div class="iframe_content">
            <div class="r_nav">
                <ul>
                  <li class="<?php if((ACTION_NAME) == "index"): ?>cur<?php endif; ?>"><a href="<?php echo U('Pintuan/index');?>">拼团订单</a></li>
	              <li class="<?php if((ACTION_NAME) == "list_product"): ?>cur<?php endif; ?>"><a href="<?php echo U('Pintuan/list_product');?>">产品列表</a></li>
	              <li class="<?php if((ACTION_NAME) == "list_tuan"): ?>cur<?php endif; ?>"><a href="<?php echo U('Pintuan/list_tuan');?>">成团列表</a></li>
	              <li class="<?php if((ACTION_NAME) == "liucheng"): ?>cur<?php endif; ?>"><a href="<?php echo U('Pintuan/liucheng');?>">购物规则</a></li>
              	  <li class="<?php if((ACTION_NAME) == "list_tui"): ?>cur<?php endif; ?>"><a href="<?php echo U('Pintuan/list_tui');?>">退款列表</a></li>
               </ul>
            </div>
            

<div id="news" class="r_con_wrap">
	<form id="product_form" class="r_con_form">
	   <div class="rows">
	        <label>商品名称</label>
	        <span class="input"><input type="text" name="name" value="<?php echo ($productinfo["name"]); ?>" class="form_input" size="35" maxlength="100" notnull /> <font class="fc_red">*</font></span>
	        <div class="clear"></div>
	    </div> 
	     
	    <div class="rows">
            <label>市场价</label>
            <span class="input"><input type="text" name="oriprice" value="<?php echo ($productinfo["oriprice"]); ?>" class="form_input" size="35" maxlength="100" notnull />&nbsp;元&nbsp;&nbsp;<font class="fc_red">*</font></span>
            <div class="clear"></div>
        </div>
        	<div class="rows">
				<label>成团内容设置</label>
				<span class="input">
					<div class="tips">填写你要收集的内容，预约默认选项不可以修改删除！</div>
					<table border="0" cellpadding="5" cellspacing="0" class="reverve_field_table" id="chengtuan_table">
						<thead>
							<tr>
								<td width="16%">成团类型</td>
								<td width="16%">成团人数</td>
								<td width="16%">成团价格(元)</td>
								<td width="20%">操作</td>
							</tr>
						</thead>
						<tbody id="chengtuan"> 								
							<tr style="display:;" fieldtype="text" mid="1">
								<td>成团类型1：</td>
								<td><span class="notime"><input type="text" class="form_input" size="55" value="<?php echo ($productgrouparr[0]['groupnumber']); ?>" name="chengtuan[]"></span></td>
								<td><span class="notime"><input type="text" class="form_input" size="55" value="<?php echo ($productgrouparr[0]['price']); ?>" name="chengtuanprice[]"></span></td>
								<td>
		                        	<a href="javascript:void(0);" class="input_add2"><img src="/pintuan/Public/Member/images/ico/add.gif"></a>
		                        </td>
							</tr>
							
							<?php if(is_array($productgrouparr)): foreach($productgrouparr as $k=>$vo): if($k > 0): ?><tr style="display:;" fieldtype="text" mid="<?php echo ($k+1); ?>">
										<td>成团类型<?php echo ($k+1); ?>：</td>
										<td><span class="notime"><input type="text" class="form_input"  size="55" value="<?php echo ($vo["groupnumber"]); ?>" name="chengtuan[]"></span></td>											
										<td><span class="notime"><input type="text" class="form_input"  size="55" value="<?php echo ($vo["price"]); ?>" name="chengtuanprice[]"></span></td>
										<td>
				                            <a href="javascript:void(0);" class="input_del2"><img src="/pintuan/Public/Member/images/ico/del.gif"></a>		                                    
				                        </td>
									</tr><?php endif; endforeach; endif; ?>
						</tbody>
					</table>
				</span>
				<div class="clear"></div>
			</div>
	    <div class="rows">
					<label>封面图</label>
					<span class="input">
						<span class="upload_file">
							<div>
								<div class="up_input">
								    <input name="ImgUpload" id="ImgUpload" type="file" width="120" height="30" style="display: none;">
								</div>
								<input type="hidden" name="ImgPath" value="<?php echo ($productinfo["coverimg"]); ?>">
								<div class="tips">图片宽度建议：280x200px</div><br/>
								<div class="clear"></div>
							</div>
							<div class="img" id="ImgDetail">
								<?php if($productinfo['coverimg'] != null): ?><a href="<?php echo ($productinfo["coverimg"]); ?>" target="_blank">
					                    <img src="<?php echo ($productinfo["coverimg"]); ?>">
					                </a><?php endif; ?> 
							</div>
						</span>
					</span>
					<div class="clear"></div>
				</div>
	    <div class="rows" id="products">
            <label>轮播展示图</label>
            <span class="input">
                <span class="upload_file">
                    <div>
                        <div class="up_input"><input name="PicUpload" id="PicUpload" type="file" /></div>
                        <div class="tips">共可上传<span id="pic_count">5</span>张图片，图片大小建议：640*320像素</div>
                        <div class="clear"></div>
                    </div>
                </span>
                <div class="img" id="PicDetail">   
                    <?php if(is_array($productinfo["imgpath"])): foreach($productinfo["imgpath"] as $key=>$vv): ?><div>
                        <a href="<?php echo ($vv); ?>" target="_blank">
                            <img src="<?php echo ($vv); ?>"></a>
                            <span>删除</span>
                            <input type="hidden" name="PicPath[]" value="<?php echo ($vv); ?>">
                        </div><?php endforeach; endif; ?> 
                </div>
            </span>
            <div class="clear"></div>
        </div>
		 <div class="rows">
	        <label>商品详情</label>
	        <span class="input"><textarea id="editor"  class="myEditor" name="description" ><?php echo ($productinfo["description"]); ?></textarea></span>
	        <div class="clear"></div>
	    </div> 
       <div class="rows">
	        <label>右侧备注</label>
	        <span class="input"><input type="text" name="remark" value="<?php echo ($productinfo["remark"]); ?>" class="form_input" size="35" maxlength="100" notnull /> <span class="tips">字数不得多于10个</span><font class="fc_red">*</font></span>
	        <div class="clear"></div>
	    </div>
	    <div class="rows">
	        <label>规格</label>
	        <span class="input"><input type="text" name="spec" value="<?php echo ($productinfo["spec"]); ?>" class="form_input" size="35" maxlength="100" notnull /> <span class="tips">例：口味、类型等</span> <font class="fc_red">*</font></span>
	        <div class="clear"></div>
	    </div>
	    
	    	<div class="rows">
				<label>规格内容设置</label>
				<span class="input">
					<div class="tips">填写你要收集的内容，预约默认选项不可以修改删除！</div>
					<table border="0" cellpadding="5" cellspacing="0" class="reverve_field_table" id="guige_table">
						<thead>
							<tr>
								<td width="16%">规格</td>
								<td width="32%">字段内容</td>
								<td width="16%">总量(个)</td>
								<?php if($productinfo["id"] != null): ?><td width="16%">库存(个)</td><?php endif; ?>
								<td width="20%">操作</td>
							</tr>
						</thead>
						<tbody id="guige"> 								
							<tr style="display:;" fieldtype="text" mid="1">
								<td>规格1：</td>
								<td><span class="notime"><input type="text" class="form_input" size="55" value="<?php echo ($productspecarr[0]['spectype']); ?>" name="guige[]"></span></td>
								<td><span class="notime"><input type="text" class="form_input" size="55" value="<?php echo ($productspecarr[0]['totalnumber']); ?>" name="total[]"></span></td>
								<?php if($productinfo["id"] != null): ?><td><span class="notime"><input type="text" class="form_input" size="55" value="<?php echo ($productspecarr[0]['restnumber']); ?>" name="rest[]"></span></td><?php endif; ?>
								<td>
		                        	<a href="javascript:void(0);" class="input_add"><img src="/pintuan/Public/Member/images/ico/add.gif"></a>
		                        </td>
							</tr>
							
							<?php if(is_array($productspecarr)): foreach($productspecarr as $k=>$vo): if($k > 0): ?><tr style="display:;" fieldtype="text" mid="<?php echo ($k+1); ?>">
										<td>规格<?php echo ($k+1); ?>：</td>
										<td><span class="notime"><input type="text" class="form_input"  size="55" value="<?php echo ($vo["spectype"]); ?>" name="guige[]"></span></td>
										<td><span class="notime"><input type="text" class="form_input"  size="55" value="<?php echo ($vo["totalnumber"]); ?>" name="total[]"></span></td>
										<td><span class="notime"><input type="text" class="form_input"  size="55" value="<?php echo ($vo["restnumber"]); ?>" name="rest[]"></span></td>
																					
										<td>
				                            <a href="javascript:void(0);" class="input_del"><img src="/pintuan/Public/Member/images/ico/del.gif"></a>		                                    
				                        </td>
									</tr><?php endif; endforeach; endif; ?>
							 
						</tbody>
					</table>
				</span>
				<div class="clear"></div>
			</div>
	    	
        <div class="rows">
	        <label></label>
	        <span class="input"><input type="button" class="btn_green" name="submit_button" value="提交保存" /><a href="<?php echo U('list_product');?>" class="btn_gray">返回</a></span>
	        <div class="clear"></div>
	    </div>
	    <input type="hidden" name="id" value="<?php echo ($id); ?>">
	    <input type="hidden" name="ispublic" value="<?php echo ($productinfo["ispublish"]); ?>">
	</form>
</div>  

         </div>
	</div>
</body>
</html>